<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
   
    <h:head>
        <title>MeteoCal | Notifications</title>
        <h:outputStylesheet name="css/style.css" />
    </h:head>
    
    <h:body>
        <div id="container">
            
        <div id="sidebar">
            <h:form>
                <p:poll interval="15" listener="#{notificationCheckBean.check()}" />
                <p:menu id="pro" model="#{menuBean.model}"  style="min-height: 615px;"/>
            </h:form>                      
        </div>
            
        <div id="content">
        <h:form id="form"> 
        <p:growl id="messages"  life="7000" showDetail="true" globalOnly="true" autoUpdate="true"/>
        <div style="float:left;width:49%;  height:290px;">
            <p:dataList  value="#{notificationBean.invitenotview}" var="invitenot" type="unordered" itemType="none" paginator="true" styleClass="paginated">
                <f:facet name="header">Invite</f:facet>
                <p:commandLink  action="#{notificationBean.loadPartEvent()}" update=":form:inviteDialog :form:weather1 :form:icon1" oncomplete="PF('inviteDialog').show()" style="float:left; margin-right:15px">
                    <f:setPropertyActionListener value="#{invitenot}" target="#{notificationBean.select}" />
                    <h:outputText value="For: #{invitenot.title}" />
                </p:commandLink>
                <h:outputText value=" from: #{invitenot.email}"  style="display:inline-block"/>
            </p:dataList>
        </div>
        <div style="float:right;width:49%; height:290px; padding-left:1%;">
            <p:dataList value="#{notificationBean.updatenotview}" var="updatenot" type="unordered" itemType="none" paginator="true" styleClass="paginated">
                 <f:facet name="header">Update event</f:facet>
                <p:commandLink  action="#{notificationBean.loadPartEvent()}" update=":form:updateDialog :form:weather2 :form:icon2" oncomplete="PF('updateDialog').show()"  style="float:left; margin-right:15px">
                    <f:setPropertyActionListener value="#{updatenot}" target="#{notificationBean.select}" />
                    <h:outputText value="For: #{updatenot.title}" />
                </p:commandLink>
                <h:outputText value=" from: #{updatenot.email}"  style="display:inline-block"/>
            </p:dataList>
        </div>
        <div style="margin-top:2%;float:left;  height:290px;width:49%">
            <p:dataList    value="#{notificationBean.day1notview}" var="day1not" type="unordered" itemType="none" paginator="true" styleClass="paginated">
             <f:facet name="header">One day before</f:facet>
                <p:commandLink  action="#{notificationBean.loadPartEvent()}" update=":form:day1Dialog :form:weather3 :form:icon3" oncomplete="PF('day1Dialog').show()" style="float:left; margin-right:15px">
                    <f:setPropertyActionListener value="#{day1not}" target="#{notificationBean.select}" />
                    <h:outputText value="For: #{day1not.title}" />
                </p:commandLink>
                <h:outputText value=" from: #{day1not.email}"  style="display:inline-block"/>
            </p:dataList>
        </div>
        <div style="margin-top:2%;float:right;width:49%;  height:290px; padding-left: 1%;">
            <p:dataList   value="#{notificationBean.days3notview}" var="days3not" type="unordered" itemType="none" paginator="true" styleClass="paginated">
                <f:facet name="header">Three day before</f:facet>
                <p:commandLink  action="#{notificationBean.loadPartEvent()}" update=":form:days3Dialog :form:button :form:weather4 :form:weather5 :form:icon4 :form:icon5"  oncomplete="PF('days3Dialog').show()" style="float:left; margin-right:15px">
                    <f:setPropertyActionListener value="#{days3not}" target="#{notificationBean.select}" />
                    <h:outputText value="For: #{days3not.title}" />
                </p:commandLink>
                <h:outputText value=" from: #{days3not.email}"  style="display:inline-block"/>
            </p:dataList>
        </div>
        
            <!--*************************************** PARTICIPATION NOTIFICATION WINDOW *********************************************-->
            <p:dialog  widgetVar="inviteDialog" header="Invite details" showEffect="scale" hideEffect="clip" resizable="false" style="max-width: 900px; max-height:530px; " >
                   <h:panelGrid id="inviteDialog" columns="2"  style="height:420px;">
                    <p:outputLabel value="Title " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.title}"/>
                    <p:outputLabel value="Location " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.location}"/>
                    <p:outputLabel value="Date " style="font-style: italic"/>
                    <h:outputText value="#{notificationBean.event.data}">
                        <f:convertDateTime pattern="EEE d MMM yyyy"  locale="en_US"  />
                    </h:outputText>
                    <p:outputLabel value="Begin time " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.beginn}"/>
                    <p:outputLabel value="End time " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.endd}"/>
                    <p:outputLabel value="Description " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.activity}"/>
                    <p:outputLabel value="Outdoor " style="font-style: italic"/>
                    <p:selectBooleanCheckbox disabled="true" value="#{notificationBean.event.outdoor}"></p:selectBooleanCheckbox>
                    <p:outputLabel value="Private " style="font-style: italic"/>
                    <p:selectBooleanCheckbox disabled="true" value="#{notificationBean.event.privatee}"></p:selectBooleanCheckbox>    
                    <p:outputLabel value="Participants " style="font-style: italic"/>
                    <p:outputLabel/>
                    <p:outputLabel/>
                    <p:dataTable var="p" value="#{notificationBean.parteveinf}"  scrollable="true" scrollHeight="120" style="height:150px;" >
                        <p:column headerText="Name">
                            <h:outputText value="#{p.name}"/>
                        </p:column>
                        <p:column headerText="Surname">
                            <h:outputText value="#{p.surname}"/>
                        </p:column>
                        <p:column headerText="Email">
                            <h:outputText value="#{p.email}"/>
                        </p:column>
                        <p:column headerText="State">
                            <h:outputText value="#{p.state}"/>
                        </p:column>
                    </p:dataTable>
                </h:panelGrid>
                                 
                <p:panel style="margin-left: auto; margin-right: auto; margin-top: 5px; max-width: 50%; border-style: none;position:relative; top:-435px;left:240px;">
                    <h:panelGrid id="weather1" columns="2" class="weather" style="float: left;width:290px;">
                        <p:outputLabel value="Condition"> </p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.description}"/>
                        <p:outputLabel value="Max Temperature"> (&deg;C)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.tempmax}"/>
                        <p:outputLabel value="Min Temperature"> (&deg;C)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.tempmin}"/>
                        <p:outputLabel value="Chance of Rain"> (&#37;)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.rain}"/>
                        <p:outputLabel value="Humidity"> (&#37;)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.humidity}"/>
                        <p:outputLabel value="Wind Speed"> (km/h)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.windspeed}"/>
                    </h:panelGrid>
                    
                 <p:graphicImage id="icon1" value="http://localhost:8080/trunk/images/#{notificationBean.weather.icon}.png" style="float:right;width:100px; height:100px;"/>

                    
                </p:panel>
                  
                 <h:panelGrid style="position:relative; top:-105px; left:-520px;" columns="2">
                    <p:commandButton ajax="true" value="DECLINE"  action="#{notificationBean.setRefused}" oncomplete="PF('inviteDialog').hide();"></p:commandButton>
                    <p:commandButton ajax="true" value="ACCEPT"  action="#{notificationBean.setConfirmed}" oncomplete="PF('inviteDialog').hide();"></p:commandButton>
                </h:panelGrid>
            </p:dialog>  
            
            <!--********************************************** EVENT UPDATE WINDOW ************************************************-->
            <p:dialog  widgetVar="updateDialog" closable="false" header="Event updated details" showEffect="scale" hideEffect="clip" resizable="false" style="max-width: 900px; max-height:530px;" >
                <h:panelGrid id="updateDialog" columns="2" style="height:420px;" >
                    <p:outputLabel value="Title " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.title}"/>
                    <p:outputLabel value="Location " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.location}"/>
                    <p:outputLabel value="Date " style="font-style: italic"/>
                    <h:outputText value="#{notificationBean.event.data}">
                        <f:convertDateTime pattern="EEE d MMM yyyy"  locale="en_US"  />
                    </h:outputText>
                    <p:outputLabel value="Begin time " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.beginn}"/>
                    <p:outputLabel value="End time " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.endd}"/>
                    <p:outputLabel value="Description " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.activity}"/>
                    <p:outputLabel value="Outdoor " style="font-style: italic"/>
                    <p:selectBooleanCheckbox disabled="true" value="#{notificationBean.event.outdoor}"></p:selectBooleanCheckbox>
                    <p:outputLabel value="Private " style="font-style: italic"/>
                    <p:selectBooleanCheckbox disabled="true" value="#{notificationBean.event.privatee}"></p:selectBooleanCheckbox>    
                    <p:outputLabel value="Participants " style="font-style: italic"/>
                    <p:outputLabel/>
                    <p:outputLabel/>
                    <p:dataTable var="p" value="#{notificationBean.parteveinf}"  scrollable="true" scrollHeight="120" style="height:150px;">
                        <p:column headerText="Name">
                            <h:outputText value="#{p.name}"/>
                        </p:column>
                        <p:column headerText="Surname">
                            <h:outputText value="#{p.surname}"/>
                        </p:column>
                        <p:column headerText="Email">
                            <h:outputText value="#{p.email}"/>
                        </p:column>
                        <p:column headerText="State">
                            <h:outputText value="#{p.state}"/>
                        </p:column>
                    </p:dataTable>
                <p:commandButton ajax="false" value="OK"  action="#{notificationBean.reload()}" oncomplete="PF('updateDialog').hide();"></p:commandButton>
                </h:panelGrid>
                
                <p:panel style="margin-left: auto; margin-right: auto; margin-top: 5px; max-width: 50%; border-style: none;position:relative; top:-450px;left:240px;">
                    
                    <h:panelGrid id="weather2" columns="2" class="weather" style="float: left;width:290px;">
                        <p:outputLabel value="Condition"> </p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.description}"/>
                        <p:outputLabel value="Max Temperature"> (&deg;C)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.tempmax}"/>
                        <p:outputLabel value="Min Temperature"> (&deg;C)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.tempmin}"/>
                        <p:outputLabel value="Chance of Rain"> (&#37;)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.rain}"/>
                        <p:outputLabel value="Humidity"> (&#37;)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.humidity}"/>
                        <p:outputLabel value="Wind Speed"> (km/h)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.windspeed}"/>
                    </h:panelGrid>
                    
                    <p:graphicImage id="icon2" value="http://localhost:8080/trunk/images/#{notificationBean.weather.icon}.png" style="float:right;width:100px;height:100px"/>
                
                </p:panel>
                
            </p:dialog>  
            
            <!--********************************************** 1DAY NOTIFICATION WINDOW ************************************************-->
             <p:dialog  widgetVar="day1Dialog" closable="false" header="Event details" showEffect="scale" hideEffect="clip" resizable="false" style="max-width: 900px; max-height:530px; " >
                   <h:panelGrid id="day1Dialog" columns="2" >
                    <p:outputLabel value="Title " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.title}"/>
                    <p:outputLabel value="Location " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.location}"/>
                    <p:outputLabel value="Date " style="font-style: italic"/>
                     <h:outputText value="#{notificationBean.event.data}">
                        <f:convertDateTime pattern="EEE d MMM yyyy"  locale="en_US"  />
                    </h:outputText>
                    <p:outputLabel value="Begin time " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.beginn}"/>
                    <p:outputLabel value="End time " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.endd}"/>
                    <p:outputLabel value="Description " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.activity}"/>
                    <p:outputLabel value="Outdoor " style="font-style: italic"/>
                    <p:selectBooleanCheckbox disabled="true" value="#{notificationBean.event.outdoor}"></p:selectBooleanCheckbox>
                    <p:outputLabel value="Private " style="font-style: italic"/>
                    <p:selectBooleanCheckbox disabled="true" value="#{notificationBean.event.privatee}"></p:selectBooleanCheckbox>    
                    <p:outputLabel value="Participants " style="font-style: italic"/>
                    <p:outputLabel/>
                    <p:outputLabel/>
                    <p:dataTable var="p" value="#{notificationBean.parteveinf}"  scrollable="true" scrollHeight="120" style="height:150px;" >
                        <p:column headerText="Name">
                            <h:outputText value="#{p.name}"/>
                        </p:column>
                        <p:column headerText="Surname">
                            <h:outputText value="#{p.surname}"/>
                        </p:column>
                        <p:column headerText="Email">
                            <h:outputText value="#{p.email}"/>
                        </p:column>
                        <p:column headerText="State">
                            <h:outputText value="#{p.state}"/>
                        </p:column>
                    </p:dataTable>
                    <p:commandButton ajax="false" value="OK"  action="#{notificationBean.reload()}" oncomplete="PF('day1Dialog').hide();"></p:commandButton>
                </h:panelGrid>
                 
                <p:panel style="margin-left: auto; margin-right: auto; margin-top: 5px; max-width: 50%; border-style: none;position:relative; top:-435px;left:240px;">
                    
                    <h:panelGrid id="weather3" columns="2" class="weather" style="float: left">
                        <p:outputLabel value="Condition"> </p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.description}"/>
                        <p:outputLabel value="Max Temperature"> (&deg;C)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.tempmax}"/>
                        <p:outputLabel value="Min Temperature"> (&deg;C)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.tempmin}"/>
                        <p:outputLabel value="Chance of Rain"> (&#37;)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.rain}"/>
                        <p:outputLabel value="Humidity"> (&#37;)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.humidity}"/>
                        <p:outputLabel value="Wind Speed"> (km/h)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.windspeed}"/>
                    </h:panelGrid>
                    
                    <p:graphicImage id="icon3" value="http://localhost:8080/trunk/images/#{notificationBean.weather.icon}.png" style="float:right;width:100px;height:100px;"/>
                
                </p:panel>
                
            </p:dialog>  
            
            <!--********************************************** 3DAYS NOTIFICATION WINDOW ************************************************-->
             <p:dialog  widgetVar="days3Dialog" closable="false" header="Event details" showEffect="scale" hideEffect="clip" resizable="false" style="max-width: 800px; max-height:640px;" >
                   <h:panelGrid id="days3Dialog" columns="2" >
                    <p:outputLabel value="Title " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.title}"/>
                    <p:outputLabel value="Location " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.location}"/>
                    <p:outputLabel value="Date " style="font-style: italic"/>
                    <h:outputText value="#{notificationBean.event.data}">
                        <f:convertDateTime pattern="EEE d MMM yyyy"  locale="en_US"  />
                    </h:outputText>
                    <p:outputLabel value="Begin time " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.beginn}"/>
                    <p:outputLabel value="End time " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.endd}"/>
                    <p:outputLabel value="Description " style="font-style: italic"/>
                    <p:outputLabel value="#{notificationBean.event.activity}"/>
                    <p:outputLabel value="Outdoor " style="font-style: italic"/>
                    <p:selectBooleanCheckbox disabled="true" value="#{notificationBean.event.outdoor}"></p:selectBooleanCheckbox>
                    <p:outputLabel value="Private " style="font-style: italic"/>
                    <p:selectBooleanCheckbox disabled="true" value="#{notificationBean.event.privatee}"></p:selectBooleanCheckbox>    
                    <p:outputLabel value="Participants " style="font-style: italic"/>
                    <p:outputLabel/>
                    <p:outputLabel/>
                   
                    <p:dataTable var="p" value="#{notificationBean.parteveinf}"  scrollable="true" scrollHeight="90" >
                        <p:column headerText="Name">
                            <h:outputText value="#{p.name}"/>
                        </p:column>
                        <p:column headerText="Surname">
                            <h:outputText value="#{p.surname}"/>
                        </p:column>
                        <p:column headerText="Email">
                            <h:outputText value="#{p.email}"/>
                        </p:column>
                        <p:column headerText="State">
                            <h:outputText value="#{p.state}"/>
                        </p:column>
                    </p:dataTable>
                   </h:panelGrid>
                  <p:panel style="margin-left: 0px; margin-right: auto; margin-top: 0px; width: 45%; border-style: none;position:relative; top:-3px;">
                    
                    <h:panelGrid  id="weather4" columns="2" class="weather" style="float:left;" >
                        <p:outputLabel value="Current Date " style="font-style: italic"/>
                    <h:outputText value="#{notificationBean.weather.date}">
                        <f:convertDateTime pattern="EEE d MMM yyyy"  locale="en_US"  />
                    </h:outputText>
                        <p:outputLabel value="Condition"> </p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.description}"/>
                        <p:outputLabel value="Max Temperature"> (&deg;C)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.tempmax}"/>
                        <p:outputLabel value="Min Temperature"> (&deg;C)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.tempmin}"/>
                        <p:outputLabel value="Chance of Rain"> (&#37;)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.rain}"/>
                        <p:outputLabel value="Humidity"> (&#37;)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.humidity}"/>
                        <p:outputLabel value="Wind Speed"> (km/h)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather.windspeed}"/> 
                    </h:panelGrid>
                    
                    <p:graphicImage id="icon4" style="position:relative; top:-140px; left:50px; float:right; width: 100px; height: 100px;" value="http://localhost:8080/trunk/images/#{notificationBean.weather.icon}.png" />

                 
                
                </p:panel>
                 
                  <p:panel style="position:relative;left:380px ;top:-268px ; margin-left: 0px; margin-right: auto; margin-top: 5px; width: 45%; border-style: none">
                    
                    <h:panelGrid  id="weather5" columns="2" class="weather"   style="float:left;" >
                       <p:outputLabel value="Suggested Date" style="font-style: italic"/>
                       <h:outputText value="#{notificationBean.weather2.date}">
                        <f:convertDateTime pattern="EEE d MMM yyyy"  locale="en_US"  />
                    </h:outputText>
                        <p:outputLabel value="Condition"> </p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather2.description}"/>
                        <p:outputLabel value="Max Temperature"> (&deg;C)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather2.tempmax}"/>
                        <p:outputLabel value="Min Temperature"> (&deg;C)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather2.tempmin}"/>
                        <p:outputLabel value="Chance of Rain"> (&#37;)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather2.rain}"/>
                        <p:outputLabel value="Humidity"> (&#37;)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather2.humidity}"/>
                        <p:outputLabel value="Wind Speed"> (km/h)</p:outputLabel>
                        <p:outputLabel value="#{notificationBean.weather2.windspeed}"/> 
                    </h:panelGrid>
                    
                  <p:graphicImage id="icon5" style="position:relative; top:-145px; left:50px; float:right; width: 100px; height: 100px;" value="http://localhost:8080/trunk/images/#{notificationBean.weather2.icon}.png" />

                 
                
                </p:panel>
                 
           
                <h:panelGrid  style="position:relative; top:120px; left:-298px;" id="button" columns="2">
                    <p:commandButton ajax="true" value="MOVE EVENT"  action="#{notificationBean.moveEvent()}" oncomplete="PF('days3Dialog').hide();"/>
                    <p:commandButton ajax="true" value="CANCEL"  action="#{notificationBean.reload()}" oncomplete="PF('days3Dialog').hide();"></p:commandButton>
                </h:panelGrid>
            </p:dialog>  
        </h:form>
        </div>
        </div>
    </h:body>
</html>